home *** CD-ROM | disk | FTP | other *** search
- Path: gail.ripco.com!mambuhl
- From: mambuhl@ripco.com (Martin Ambuhl)
- Newsgroups: comp.lang.c
- Subject: Re: Schildt <- Advanced B
- Date: 9 Mar 1996 01:57:23 GMT
- Organization: Ripco Communications, Inc.
- Message-ID: <4hqoi3$k4g@gail.ripco.com>
- NNTP-Posting-Host: cook.ripco.com
-
- anh@kuhub.cc.ukans.edu
- in <1996Mar7.162150.115560@kuhub.cc.ukans.edu> asks...
-
- In regard to the Schildtism
- >>>> float f
- >>>> printf("%f ", sizeof f);
- >>>> printf("%d", sizeof(int));
-
- >Er, so what do you use instead of %d ?
-
- size_t is only guaranteed to be an "unsigned integral type." Since the
- only standard data type guaranteed to hold a standard unsigned integral
- data value is `unsigned long', that's what you must use, so:
-
- float f
- printf("%lu ", (unsigned long)sizeof f);
- printf("%lu", (unsigned long)sizeof(int));
-
-
- --
- * Martin Ambuhl net: mambuhl@ripco.com
- * Chicago, IL (USA)
-